home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Enlighten DSM 1.1
/
SGI EnlightenDSM 1.1.iso
/
hp10x
/
emd.z
/
emd
/
bin
/
enl_post_install
< prev
next >
Wrap
Text File
|
1998-06-30
|
24KB
|
985 lines
#!/bin/sh
#
# Post-install script for the Enlighten 2.0 products
#
# usage: enl_post_install [-norc] [-nostart] \
# [-trap <host>] [-community <name>]
# [-informix <DB_path>] [-emdir <emd_dir>] [-emdhost <host>] \
# [-pephost <host>] [-enlighten <path>] [-installhost <host>] \
# [-installhostip <second try host for e_validate> \
# [-allowedhosts <hosts> ] [<component> ...]
#
# <component> ::= events
# ::= admin
# ::= pep
# ::= emd
# ::= renld
#
# Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
# All rights reserved.
#
umask 077
exit_door() {
#
# The install gui is keyed to look for the string
# "Configuration was successful." or "Configuration failed."
# to determine the script's completion. Don't change these strings
# without changing install/gui/nodeDist.c's EXIT_TOKEN strings.
#
if [ "$error" -eq 1 ] ; then
echo "Configuration failed." 1>&2
echo "Configuration failed."
else
echo "Configuration was successful." 1>&2
echo "Configuration was successful."
fi
exit $error
}
error_check () {
if [ $? -ne 0 ] ; then
echo "$appName: Fatal: Could not successfully finish configuring Enliughten" >> $LOG
error=1
exit_door
fi
}
PATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/bsd:/usr/etc:$PATH ; export PATH
# Global constants for easy modification
KEY_FILE="/etc/enlighten"
appName=`basename $0`
localhost=`uname -n`
postinstall_agent="postinstall_agent"
postinstall_sysadm="postinstall_sysadm"
postinstall_emd="postinstall_emd"
start_enl_daemons="start_enl_daemons"
e_putrc="e_putrc"
e_validate="e_validate"
renld_prog="renld"
agent_prog="AgentMon"
allow_hosts=""
pep_prog="pep"
pep_rules="contrib/rules.txt"
pephost=""
emdhost=""
db_path=""
dbenl=""
community="public"
trap_host=`uname -n`
TMPFILE="/tmp/enlinstall.$$"
PEP_SLEEP_TIME=25
install_host=""
install_host_ip=""
flexdaemon="lmgrd"
flexlog="lmgrd.log"
dsmld="dsmld"
licfile="license.dat"
# Run-time flags
start_at_boot=1
start_daemons_now=1
do_all=1
verbs=0
do_events=0
do_events_upgrade=0
do_admin=0
do_admin_upgrade=0
do_emd=0
do_emd_upgrade=0
do_renld=0
do_renld_upgrade=0
do_pep=0
do_pep_upgrade=0
do_lic=0
do_lic_upgrade=0
# check command line arguments
if [ "$#" -lt 1 ] ; then
echo
echo "Usage: $appName [-norc] [-nostart] "
echo " [-trap <host>] [-community <name>] "
echo " [-informix <path>] [ -emdir <emd_dir>] "
echo " [-enlighten <enlighten_path>] [-allowedhosts <hosts>]"
echo " [-pephost <host>] [-emdhost <host>] [-enlighten <path>]"
echo " [-dbhome <path>] [-installhost <host>] [<component upgrade_flag> ...]"
echo
echo " <component> ::= events admin renld pep emd lic"
echo " upgrade_flag 0 to install, 1 to upgrade"
echo
exit 1
fi
error=0
while [ $# -ne 0 ] ; do
case "$1" in
events )
do_events=1
do_all=0
do_events_upgrade=$2
shift
;;
admin )
do_admin=1
do_all=0
do_admin_upgrade=$2
shift
;;
renld )
do_renld=1
do_all=0
do_renld_upgrade=$2
shift
;;
pep )
do_pep=1
do_all=0
pephost=`uname -n`
do_pep_upgrade=$2
shift
;;
emd )
do_emd=1
do_all=0
if test -z "$emdhost" ; then
emdhost=`uname -n`
fi
do_emd_upgrade=$2
shift
;;
lic )
do_lic=1
do_all=0
do_lic_upgrade=$2
shift
;;
-norc )
start_at_boot=0
;;
-nostart )
start_daemons_now=0
;;
-trap )
trap_host=$2
shift
;;
-community )
community=$2
shift
;;
-enlighten )
ENLIGHTEN=$2
shift
;;
-emdhost )
emdhost=$2
shift
;;
-pephost )
pephost=$2
shift
;;
-allowedhosts )
allow_hosts=$2
shift
;;
-informix )
db_path=$2
shift
;;
-dbhome )
dbenl=$2
shift
;;
-emdir )
emd_dir=$2
shift
;;
-installhost )
install_host=$2
shift
;;
-installhostip )
install_host_ip=$2
shift
;;
* )
echo $appName": Invalid component name: $1"
;;
esac
shift
done
# export shell variables
export ENLIGHTEN emd_dir KEY_FILE
if [ -n "$ENLIGHTEN" ] ; then
execdir=${ENLIGHTEN}/bin
if [ ! -d "${ENLIGHTEN}/logs" ] ; then
mkdir -p ${ENLIGHTEN}/logs
if [ $? -ne 0 ] ; then
echo "$appName: Fatal: Could not mkdir $ENLIGHTEN/logs." 1>&2
exit 1
fi
fi
else
if [ -n "$emd_dir" ] ; then
execdir=${emd_dir}/bin
if [ ! -d "${emd_dir}/logs" ] ; then
mkdir -p ${emd_dir}/logs
if [ "$?" -ne 0 ] ; then
echo "$appName: Fatal: Could not mkdir $emd_dir/logs." 1>&2
exit 1
else
chmod 700 ${emd_dir}/logs
fi
fi
fi
fi
if [ -z "$execdir" -o ! -d "$execdir" ] ; then
echo "$appName: Fatal: 'enlighten' and 'emd_dir' was not found." 1>&2
exit 1
fi
if [ "$verbs" -eq 1 ]; then
echo "execdir is: $execdir"
fi
# ----------------------------------------------------------------------------
# Update the /etc/enlighten file
# ----------------------------------------------------------------------------
if [ ! -f "$KEY_FILE" ] ; then
echo "#" > $KEY_FILE
echo "# File: $KEY_FILE" >> $KEY_FILE
echo "#" >> $KEY_FILE
echo "# This file is used by all Enlighten components as a common repository" >> $KEY_FILE
echo "# for the root Enlighten directory, the hostnames of the PEP and EMD servers," >> $KEY_FILE
echo "# and the installation host (used for automatic license administration)." >> $KEY_FILE
echo "#" >> $KEY_FILE
echo "# Note that editting this file has the potential to corrupt the local" >> $KEY_FILE
echo "# installation of Enlighten." >> $KEY_FILE
echo "#" >> $KEY_FILE
echo "# Copyright (c) 1990-1998 Enlighten Software Solutions, Inc." >> $KEY_FILE
echo "# All Rights Reserved" >> $KEY_FILE
echo "#" >> $KEY_FILE
echo " " >> $KEY_FILE
else
#
# Remove any tokens from /etc/enlighten that will be rewritten.
#
cp $KEY_FILE ${KEY_FILE}.old
if [ -n "$ENLIGHTEN" ] ; then
egrep -v "^enlighten=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
if [ -n "$install_host" ] ; then
egrep -v "^install_host=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
if [ -n "$install_host_ip" ] ; then
egrep -v "^install_host_ip=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
if [ -n "$emdhost" ] ; then
egrep -v "^emd_host=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
if [ -n "$emd_dir" ] ; then
egrep -v "^emd_dir=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
if [ -n "$pephost" ] ; then
egrep -v "^pep_host=" $KEY_FILE > ${KEY_FILE}.tmp
mv ${KEY_FILE}.tmp $KEY_FILE
fi
fi
#
# Insert the tokens
#
if [ -n "$ENLIGHTEN" ] ; then
echo "enlighten=$ENLIGHTEN" >> $KEY_FILE
fi
if [ -n "$install_host" ] ; then
echo "install_host=$install_host" >> $KEY_FILE
fi
if [ -n "$install_host_ip" ] ; then
echo "install_host_ip=$install_host_ip" >> $KEY_FILE
fi
if [ -n "$emdhost" ] ; then
echo "emd_host=$emdhost" >> $KEY_FILE
fi
if [ -n "$emd_dir" ] ; then
echo "emd_dir=$emd_dir" >> $KEY_FILE
fi
if [ -n "$pephost" ] ; then
echo "pep_host=$pephost" >> $KEY_FILE
fi
# Override the umask of root
chown root $KEY_FILE
chmod 444 $KEY_FILE
# ----------------------------------------------------------------------------
# Make the .data and log and patches directories
# ----------------------------------------------------------------------------
LOG="${execdir}/../logs/config.log"
if [ -n "$ENLIGHTEN" ] ; then
if [ ! -d "${ENLIGHTEN}/.data" ] ; then
mkdir -p ${ENLIGHTEN}/.data
if [ "$?" -ne 0 ] ; then
echo "$appName: Fatal: mkdir ${ENLIGHTEN}/.data failed." 1>&2
error=1
fi
fi
if [ ! -d "${ENLIGHTEN}/patches" ] ; then
mkdir -p ${ENLIGHTEN}/patches
if [ "$?" -ne 0 ] ; then
echo "$appName: Fatal: mkdir ${ENLIGHTEN}/patches failed." 1>&2
error=1
fi
fi
if [ ! -d "${ENLIGHTEN}/logs" ] ; then
mkdir -p ${ENLIGHTEN}/logs
if [ "$?" -ne 0 ] ; then
echo "$appName: Fatal: mkdir ${ENLIGHTEN}/logs failed." 1>&2
error=1
fi
fi
# Deal with SCO 32 tar bug
if [ -d "${ENLIGHTEN}/msg/C" ] ; then
chmod 700 ${ENLIGHTEN}/msg/C
chmod 400 ${ENLIGHTEN}/msg/C/*.mcat
fi
fi
echo "$appName: Starting configuration on `date`" >> $LOG
#-----------------------------------------------------------------------------
# Create the group enldsm
#----------------------------------------------------------------------------
ypcat_group_output=/tmp/$appName.yg
niscat_group_output=/tmp/$appName.ng
enldsm_gid=1000 ; export enldsm_gid
ETCGROUP=/etc/group
os_name=`uname -s`
os_release=`uname -r`
temp_file=/tmp/$appName.$$
# Determine what ps options to use.
# All systems use "-e" expcept for
# SunOS 4.1.3 and 4.1.4 that use -auxww
ps_opts="-e"
if [ "$os_name" = "SunOS" ] ; then
case "$os_release" in
4.1.* )
ps_opts="-auxww" ;;
* ) ;;
esac
fi
# Determine if NIS or NIS+ is running
unset nis_running
if [ -n "`ps $ps_opts | grep ypbind | grep -v grep`" ] ; then
# Ensure NIS is actually up and functional
ypcat group 2> /dev/null > $ypcat_group_output
if [ $? -ne 0 ] ; then
echo "$appName: Host was found to be running ypbind, but 'ypcat group' failed." >> $LOG
else
nis_running="true"
fi
fi
if [ -n "`ps $ps_opts | grep nis_cach | grep -v grep`" ] ; then
# Ensure NIS+ is actually up and functional
niscat group.org_dir 2> /dev/null > $niscat_group_output
if [ $? -ne 0 ] ; then
echo "$appName: The NIS+ client daemon was up, but 'niscat group.org_dir' failed." >> $LOG
else
nis_plus_running="true"
fi
fi
force_local_enldsm_group="true"
# See if group 'enldsm' is defined
unset enldsm_group_exists
if [ -n "`grep '^enldsm:' $ETCGROUP`" ] ; then
enldsm_group_exists="true"
enldsm_gid=`grep "^enldsm:" $ETCGROUP | cut '-d:' -f3`
elif [ -z "$force_local_enldsm_group" -a "$nis_running" ] ; then
if [ -n "`grep '^enldsm:' $ypcat_group_output`" ] ; then
enldsm_group_exists="true"
enldsm_gid=`grep "^enldsm:" $ypcat_group_output | cut '-d:' -f3`
fi
elif [ -z "$force_local_enldsm_group" -a "$nis_plus_running" ] ; then
if [ -n "`grep '^enldsm:' $niscat_group_output`" ] ; then
enldsm_group_exists="true"
enldsm_gid=`grep "^enldsm:" $niscat_group_output | cut '-d:' -f3`
fi
fi
# Create the 'enldsm' group if necessary
if [ ! "$enldsm_group_exists" ] ; then
# Make a temporary file with all the current gid #s
# (using a temp file lets me only call ypcat or niscat once.)
cut '-d:' -f3 $ETCGROUP > $temp_file
error_check
if [ "$nis_running" ] ; then
cat $ypcat_group_output | cut '-d:' -f3 >> $temp_file
error_check
fi
if [ "$nis_plus_running" ] ; then
cat $niscat_group_output | cut '-d:' -f3 >> $temp_file
error_check
fi
# Now search through that file to find a unique id.
while [ -n "`fgrep -x $enldsm_gid $temp_file`" ] ; do
if [ "$verbose_output" ] ; then
echo "$appName: 'enldsm' gid $enldsm_gid was not unique." >> $LOG
fi
enldsm_gid=`expr 1 + $enldsm_gid`
done
# Backup $ETCGROUP
cp $ETCGROUP $ETCGROUP.orig
echo "$appName: $ETCGROUP was archived to $ETCGROUP.orig" >> $LOG
# And add the entry to the start of $ETCGROUP
rm -f $temp_file
error_check
lineno=`grep -n "^+" $ETCGROUP | awk -F: '{print $1}'`
if [ $lineno ] ; then
sed -e ''${lineno}'i\
enldsm::'${enldsm_gid}':' $ETCGROUP > $temp_file
error_check
else
cat $ETCGROUP > $temp_file
error_check
echo 'enldsm::'${enldsm_gid}':' >> $temp_file
error_check
fi
cp $temp_file $ETCGROUP
error_check
chmod 644 $ETCGROUP
error_check
rm -f $temp_file
error_check
echo "$appName: Group 'enldsm' (gid=$enldsm_gid) was added successfully." >> $LOG
fi
# ----------------------------------------------------------------------------
# Do EMD Post-installation
# ----------------------------------------------------------------------------
if [ "$do_emd" -eq 1 -o "$do_all" -eq 1 ] ; then
echo "$appName: Post-installing EMD...." >> $LOG
if [ -n "$emd_dir" ] ; then
if [ ! -d "${emd_dir}/patches" ] ; then
mkdir -p ${emd_dir}/patches
fi
fi
if [ "$db_path" != "" ] ; then
infmx_path="-f $db_path"
else
infmx_path=""
fi
if [ "$emd_dir" != "" ] ; then
emdir="-emdir $emd_dir"
else
emdir=""
fi
if [ "$dbenl" != "" ] ; then
dbhome="-dbhome $dbenl"
else
dbhome=""
fi
upgrade_flag="-upgrade $do_emd_upgrade"
if [ -x "${emd_dir}/bin/${postinstall_emd}" ] ; then
${emd_dir}/bin/${postinstall_emd} $infmx_path $emdir $dbhome $upgrade_flag >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
else
if [ -x "${execdir}/${postinstall_emd}" ] ; then
${execdir}/${postinstall_emd} $infmx_path $emdir $dbhome $upgrade_flag >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
else
echo "$appName: Fatal: $postinstall_emd is missing." 1>&2
error=1
fi
fi
#
# part of emd post installation is to do the licensing postinstall.
#
flexdir="${emd_dir}/FLEXlm"
chown dbenl ${flexdir}/*
if [ "$?" -ne 0 ] ; then
error=1
fi
# remove old links and create new ones
if [ -f "${flexdir}/lmdown" ] ; then
rm ${flexdir}/lmdown
fi
if [ -f "${flexdir}/lmcksum" ] ; then
rm ${flexdir}/lmcksum
fi
if [ -f "${flexdir}/lmdiag" ] ; then
rm ${flexdir}/lmdiag
fi
if [ -f "${flexdir}/lmhostid" ] ; then
rm ${flexdir}/lmhostid
fi
if [ -f "${flexdir}/lminstall" ] ; then
rm ${flexdir}/lminstall
fi
if [ -f "${flexdir}/lmremove" ] ; then
rm ${flexdir}/lmremove
fi
if [ -f "${flexdir}/lmreread" ] ; then
rm ${flexdir}/lmreread
fi
if [ -f "${flexdir}/lmswitchr" ] ; then
rm ${flexdir}/lmswitchr
fi
if [ -f "${flexdir}/lmstat" ] ; then
rm ${flexdir}/lmstat
fi
ln ${flexdir}/lmutil ${flexdir}/lmdown
ln ${flexdir}/lmutil ${flexdir}/lmcksum
ln ${flexdir}/lmutil ${flexdir}/lmdiag
ln ${flexdir}/lmutil ${flexdir}/lmhostid
ln ${flexdir}/lmutil ${flexdir}/lminstall
ln ${flexdir}/lmutil ${flexdir}/lmremove
ln ${flexdir}/lmutil ${flexdir}/lmreread
ln ${flexdir}/lmutil ${flexdir}/lmswitchr
ln ${flexdir}/lmutil ${flexdir}/lmstat
# we can't start the daemon if this exists
# and is owned by somebody else
rm -f /usr/tmp/lockdsmld > /dev/null 2>&1
# Start the license daemons
su dbenl -c "${flexdir}/start_dsmld"
if [ "$?" -eq 1 ] ; then
error=1
fi
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
#----------------------------------------------------------------------------
# Do license file post_install
#---------------------------------------------------------------------------
#
# If we not installin/upgrading the emd portion but have got a new license
# file to work with, we must tell the dsmld to reread the file.
# If the emd was installed, the license daemons would alreadsy have been
# handles in the code above, so do nothing.
if [ "$do_emd" -eq 0 -a "$do_lic" -eq 1 ] ; then
flexdir=${emd_dir}/FLEXlm
chown dbenl ${emd_dir}/FLEXlm/${licfile}
# don't do anything if license daemons aren't installed
if [ -f ${flexdir}/lmgrd -a -f ${flexdir}/dsmld -a -f ${flexdir}/start_dsmld -a ${flexdir}/lmutil ] ; then
su dbenl -c "${flexdir}/start_dsmld"
if [ "$?" -eq 1 ] ; then
error=1
fi
fi
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
# ----------------------------------------------------------------------------
# Do Events Post-installation
# ----------------------------------------------------------------------------
if [ "$do_events" -eq 1 -o "$do_all" -eq 1 ] ; then
if [ -d ${ENLIGHTEN}/data ] ; then
chmod g-s ${ENLIGHTEN}/data
fi
echo "$appName: Post-installing Events..." >> $LOG
${execdir}/${postinstall_agent} $trap_host $community $do_events_upgrade >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
# ----------------------------------------------------------------------------
# Do RENLD and GUI post-installation
# ----------------------------------------------------------------------------
if [ "$do_renld" -eq 1 -o "$do_all" -eq 1 ] ; then
if [ -d ${ENLIGHTEN}/data ] ; then
chmod g-s ${ENLIGHTEN}/data
fi
HOSTS_ALLOW="${ENLIGHTEN}/config/hosts.allow"
HOSTS_ALLOW_BAK="${ENLIGHTEN}/config/hosts.allow.bak"
echo "$appName: Post-installing renld and GUI...." >> $LOG
if [ "$do_renld_upgrade" -eq 1 ] ; then
if [ -f "$HOSTS_ALLOW_BAK" ] ; then
cp $HOSTS_ALLOW_BAK $HOSTS_ALLOW
if [ "$?" -ne 0 ] ; then
error=1
echo "Unable to copy $HOSTS_ALLOW_BAK to $HOSTS_ALLOW" >> $LOG
fi
fi
else
if [ "$allow_hosts" != "" ] ; then
for i in $allow_hosts
do
if [ ! -f "$HOSTS_ALLOW" ] ; then
echo $i > $HOSTS_ALLOW
else
echo $i >> $HOSTS_ALLOW
fi
done
fi
fi
fi
if [ "$do_renld" -eq 1 -o "$do_admin" -eq 1 -o "$do_all" -eq 1 ] ; then
${execdir}/${postinstall_sysadm} $do_admin_upgrade >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
#-----------------------------------------------------------------------------
# Do PEP postinstall
#-----------------------------------------------------------------------------
if [ "$do_pep" -eq 1 -a "$do_pep_upgrade" -eq 1 ] ; then
if [ -f "${ENLIGHTEN}/${pep_rules}" ] ; then
cp ${ENLIGHTEN}/${pep_rules} ${ENLIGHTEN}/contrib/rules.new
if [ -f "${ENLIGHTEN}/contrib/rules.bak" ] ; then
cp ${ENLIGHTEN}/contrib/rules.bak ${ENLIGHTEN}/${pep_rules}
fi
fi
fi
#----------------------------------------------------------------------------
# Create the manifest files
# The files will be sorted after the rc references are added...
#---------------------------------------------------------------------------
# Get the install dirs from /etc/enlighten
emd_etc=`egrep "^emd_dir=" /etc/enlighten | cut '-d=' -f2-`
enl_etc=`egrep "^enlighten=" /etc/enlighten | cut '-d=' -f2-`
if [ "$emd_etc" = "$enl_etc" ] ; then
same_dir=1
else
same_dir=0
fi
if [ \( "$do_emd" -eq 1 -o "$do_lic" -eq 1 \) -a "$same_dir" -eq 0 ] ; then
emd_manifest="${emd_dir}/manifest"
echo /etc/enlighten > $emd_manifest
find $emd_dir -print | egrep -v "emdd.log" >> $emd_manifest
fi
if [ "$do_pep" -eq 1 -o "$do_events" -eq 1 -o "$do_admin" -eq 1 -o "$do_renld" -eq 1 ] ; then
enl_manifest=${ENLIGHTEN}/manifest
# directories with run-time files we want to omit
formlet="config/formlet"
usert="config/user-templates"
usera="config/userauth"
backup="config/backup"
defpool="config/defaultpool"
overrides="config/overrides"
rfd="config/rfd"
wxy="config/wxy"
dotdata=".data"
data="data"
logs="logs"
lpr="lpr"
secure="secure"
tmp="tmp"
work="work"
# run-time files we want to eliminate
testtab="config/testtab"
enlcmd="config/enlcmd.log"
# installed files/directories we want to add back to manifest because
# the directory had many run-time files so we omitted the entire directory
hidden=".data/.enlighten"
createdb="logs/createdb.log"
icon1="icons/C/secure_cls"
icon2="icons/C/secure_dtop"
icon3="icons/C/secure_icon"
icon4="icons/C/network_cls"
icon5="icons/C/network_dtop"
icon6="icons/C/network_icon"
backup1="config/backup/8mm"
backup2="config/backup/cart"
backup3="config/backup/jobs"
backup4="config/backup/log"
backup5="config/backup/logfiles"
backup6="config/backup/raw"
backup7="config/backup/reel"
backup8="config/backup/regular"
backup9="config/backup/table"
rfd1="config/rfd/jobs"
rfd2="config/rfd/logfiles"
# omit files in small chunks to that egrep on SunOs can handle it
omit1="$formlet|$usert|$usera"
omit2="$backup|$defpool|$overrides"
omit3="$rfd|$wxy|$testtab"
omit4="$enlcmd|$dotdata|$data"
omit5="$logs|$lpr|$secure|$tmp|$work"
append="$formlet $usert $usera $backup $defpool $overrides $rfd $wxy $dotdata $data $logs $lpr $secure $tmp $work"
append2="$backup1 $backup2 $backup3 $backup4 $backup5 $backup6 $backup7 $backup8 $backup9 $rfd1 $rfd2"
append_files="$hidden $icon1 $icon2 $icon3 $icon4 $icon5 $icon6"
# now we're ready to populate the file...
echo /etc/enlighten > $enl_manifest
find $ENLIGHTEN -print | egrep -v "$omit1" | egrep -v "$omit2" | egrep -v "$omit3" | egrep -v "$omit4" | egrep -v "$omit5" >> $enl_manifest
# add back in installed directories/files that were omitted
for i in $append
do
if [ -d ${ENLIGHTEN}/$i ] ; then
echo ${ENLIGHTEN}/$i >> $enl_manifest
fi
done
for i in $append2
do
if [ -d ${ENLIGHTEN}/$i ] ; then
echo ${ENLIGHTEN}/$i >> $enl_manifest
fi
done
for i in $append_files
do
if [ -f ${ENLIGHTEN}/$i ] ; then
echo ${ENLIGHTEN}/$i >> $enl_manifest
fi
done
if [ -f ${ENLIGHTEN}/data/install.db ] ; then
echo ${ENLIGHTEN}/data/install.db >> $enl_manifest
fi
if [ "$same_dir" -eq 1 ] ; then
echo ${ENLIGHTEN}/${createdb} >> $enl_manifest
fi
fi
# ----------------------------------------------------------------------------
# Install the rc reference
# ----------------------------------------------------------------------------
#
# Because e_putrc will be referencing start_enl_daemons, make sure that
# file exists before installing the rc file.
#
if [ ! -x "${execdir}/${start_enl_daemons}" ] ; then
echo "$appName: Fatal: $execdir/$start_enl_daemons is missing." 1>&2
error=1
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
if [ "$start_at_boot" -eq 1 ] ; then
if [ -x "${execdir}/${e_putrc}" ] ; then
${execdir}/${e_putrc} >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
else
echo "$appName: Fatal: $execdir/$e_putrc is missing." 1>&2
error=1
fi
fi
if [ "$error" -eq 1 ] ; then
exit_door
fi
#-----------------------------------------------------------------------------
# sort the manifest files now that rc refernces added in
#----------------------------------------------------------------------------
if [ -n "$emd_manifest" ] ; then
tmp_sort=${emd_dir}/manifest.tmp
sort $emd_manifest > $tmp_sort
mv $tmp_sort $emd_manifest
fi
if [ -n "$enl_manifest" ] ; then
tmp_sort=${emd_dir}/manifest.tmp
sort $enl_manifest > $tmp_sort
mv $tmp_sort $enl_manifest
fi
#--------------------------------------------------------------------------
# Make sure all installed files in group enldsm
#-------------------------------------------------------------------------
if [ "$do_emd" -eq 1 ] ; then
for i in bin patches logs FLEXlm man manifest msg odbc
do
chgrp -R enldsm ${emd_dir}/$i
done
for i in .create_emd_tables.sh .dbaccess_input.txt .odbc.ini .odbc.ini.orig .profile .profile.orig dbexport.out
do
if [ -f ${emd_dir}/$i ] ; then
chgrp enldsm ${emd_dir}/$i
fi
done
chgrp enldsm $emd_dir
chgrp enldsm ${emd_dir}/dbtables
fi
if [ "$do_pep" -eq 1 -o "$do_events" -eq 1 -o "$do_admin" -eq 1 -o "$do_renld" -eq 1 ] ; then
chgrp -R enldsm $ENLIGHTEN
fi
# ----------------------------------------------------------------------------
# Start the daemons
# ----------------------------------------------------------------------------
if [ "$start_daemons_now" -eq 1 ] ; then
${execdir}/${start_enl_daemons} >> $LOG
if [ "$?" -ne 0 ] ; then
error=1
fi
fi
exit_door